<?php

/**
 * School form.
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class SchoolForm extends BaseSchoolForm
{
  public function configure()
  {
      $this->getWidget('sector_intg_id')->setOption('key_method','getIntgId');              
      $this->getValidator('sector_intg_id')->setOption('column','intg_id');
      
      $this->widgetSchema['intg_id'] = new sfWidgetFormInput();
      $this->widgetSchema->setLabels(array('intg_id'=>'School number'));
      $this->validatorSchema['intg_id'] = new sfValidatorInteger(array('required' => true));
      $this->validatorSchema->setPostValidator( 
          new sfValidatorAnd(array(
            new sfValidatorDoctrineUnique(array('required' => true,'model'=>'School','column'=>'intg_id','object'=>$this->getObject()))
      )));
      $this->setCustomFormatter();
  }
}
